"""doc"""

import re

from . import app_except

#
PATTERN_NAME = re.compile(r"\S{2,50}")


def check_name(s):
    if PATTERN_NAME.fullmatch(s) == None:
        raise app_except.NameInValid


#
PATTERN_TELEPHONE = re.compile(r"1[0-9]{10,10}")


def check_telephone(s):
    if PATTERN_TELEPHONE.fullmatch(s) == None:
        raise app_except.PhoneInValid


#


def check_url(s: str):
    if not s.startswith(("https://", "cloud://")):
        raise app_except.UrlInValid
